package com.first.service.Impl;

import com.first.entity.SubjectEntity;
import com.first.mapper.SubjectMapper;
import com.first.service.SubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SubjectServiceImpl implements SubjectService {

    @Autowired
    private SubjectMapper subjectMapper;


    @Override
    public List<SubjectEntity> getSubjectList() {
        List<SubjectEntity> subjectList = subjectMapper.getSubjectList();
        return subjectList;
    }

    @Override
    public int updateSubject(String subjectName, String subjectInfo, Integer credit, Integer id) {
        int i = subjectMapper.updateSubject(subjectName, subjectInfo, credit, id);
        return i;
    }

    @Override
    public int deleteSubject(Integer id) {
        int i = subjectMapper.deleteSubject(id);
        return i;
    }

    @Override
    public int insertSubject(String subjectName, String subjectInfo, Integer credit) {
        int i = subjectMapper.insertSubject(subjectName, subjectInfo, credit);
        return i;
    }
}
